#===============================================================================
# @brief    cmake file
# Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2023. All rights reserved.
#===============================================================================
add_subdirectory_if_exist(adc)
add_subdirectory_if_exist(capsensor)
add_subdirectory_if_exist(comparator)
add_subdirectory_if_exist(cpu_trace)
add_subdirectory_if_exist(dma)
add_subdirectory_if_exist(dntc)
add_subdirectory_if_exist(dpu)
add_subdirectory_if_exist(eflash)
add_subdirectory_if_exist(flash)
add_subdirectory_if_exist(fmc)
add_subdirectory_if_exist(gllbcnt)
add_subdirectory_if_exist(gpio)
add_subdirectory_if_exist(epmu)
add_subdirectory_if_exist(i2c)
add_subdirectory_if_exist(i2s)
add_subdirectory_if_exist(idau)
add_subdirectory_if_exist(ipc)
add_subdirectory_if_exist(ir)
add_subdirectory_if_exist(keyscan)
add_subdirectory_if_exist(lcd)
add_subdirectory_if_exist(lpc)
add_subdirectory_if_exist(lpm)
add_subdirectory_if_exist(memory_core)
add_subdirectory_if_exist(memory_monitor)
add_subdirectory_if_exist(mipi)
add_subdirectory_if_exist(mmc)
add_subdirectory_if_exist(mpu)
add_subdirectory_if_exist(nand_flash)
add_subdirectory_if_exist(opi)
add_subdirectory_if_exist(otp)
add_subdirectory_if_exist(pcie)
add_subdirectory_if_exist(pcm)
add_subdirectory_if_exist(pinmux)
add_subdirectory_if_exist(pmp)
add_subdirectory_if_exist(psram)
add_subdirectory_if_exist(pwm)
add_subdirectory_if_exist(qdec)
add_subdirectory_if_exist(qspi)
add_subdirectory_if_exist(sau)
add_subdirectory_if_exist(sdio)
add_subdirectory_if_exist(security)
add_subdirectory_if_exist(security_unified)
add_subdirectory_if_exist(security_unified/drv_hitls)
add_subdirectory_if_exist(spi)
add_subdirectory_if_exist(ssi)
add_subdirectory_if_exist(systick)
add_subdirectory_if_exist(tcxo)
add_subdirectory_if_exist(tgu)
add_subdirectory_if_exist(timer)
add_subdirectory_if_exist(touch)
add_subdirectory_if_exist(tsensor)
add_subdirectory_if_exist(uart)
add_subdirectory_if_exist(ulp_aon)
add_subdirectory_if_exist(usb)
add_subdirectory_if_exist(vau)
add_subdirectory_if_exist(watchdog)
add_subdirectory_if_exist(xip)
add_subdirectory_if_exist(pdm)
add_subdirectory_if_exist(calendar)
add_subdirectory_if_exist(qspi_display)
add_subdirectory_if_exist(sfc)
add_subdirectory_if_exist(mtd)
add_subdirectory_if_exist(button)
add_subdirectory_if_exist(pm)
add_subdirectory_if_exist(edge)
add_subdirectory_if_exist(usb_unified)
add_subdirectory_if_exist(rtc_unified)
add_subdirectory_if_exist(efuse)
add_subdirectory_if_exist(can_fd)

set(_CHIP "${CHIP}")
if(${CHIP} STREQUAL "socmn1")
    set(_CHIP "melody")
endif()

if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/audio/CMakeLists.txt)
    add_subdirectory(audio)
elseif(EXISTS ${BIN_DIR}/${_CHIP}/libs/audio/CMakeLists.txt)
    add_subdirectory(${BIN_DIR}/${_CHIP}/libs/audio audio)
endif()
